﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestCollectiona : MonoBehaviour
{

	Queue<Block> queues = new Queue<Block> ();

	void Start ()
	{
		for (int x = 0; x < 5; x++) {
			GameObject o = (GameObject)Instantiate (GameDefine.instance.blockPrefap, new Vector3 (x, 0, 0), Quaternion.identity);
			Block bl = o.GetComponent<Block> ();
			bl.x = x;
			bl.colorId = 1;
			queues.Enqueue (bl);
		}

	}

	void Update ()
	{
		if (Input.GetKeyDown (KeyCode.LeftArrow)) {
			Block bl = queues.Dequeue ();
			Destroy (bl.gameObject);
		}
	}
}
